module namespace utilities = "http://www.xmlproject.com/smi/lib/utilities";

declare function utilities:generate-dates()
{
    let $var :=""
    return 
    <select name="year">
        <option>- Year -</option>{
        for $year in 1900 to 2012
        order by $year descending
        return
        <option value="{$year}">{$year}</option>
        }
    </select>
}; 




declare function utilities:similarTitles($title1 as xs:string, $title2 as xs:string) as xs:boolean
{
    let $title1_without_symbols := lower-case(normalize-space(replace(replace($title1, ":", ""), "-", "")))
    let $title2_without_symbols := lower-case(normalize-space(replace(replace($title2, ":", ""), "-", "")))
    return
        (contains($title1_without_symbols,$title2_without_symbols)
         or
         contains($title2_without_symbols, $title1_without_symbols)
         or
         compare($title1_without_symbols, $title2_without_symbols) = 0
         )
}; 